package org.springblade.modules.admin.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.springblade.core.tool.node.INode;
import org.springblade.modules.system.vo.DictVO;

import java.util.ArrayList;
import java.util.List;

/**
    * 维保小组表
    */
@Data
public class MaintainGroupTreeVo implements INode<MaintainGroupTreeVo> {

	/**
	 * ID
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;
	/**
     * 组名称
     */
    private String parentName;

    @JsonSerialize(using = ToStringSerializer.class)
	private Long parentId;

    /**
     * 子级
	 */
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private List<MaintainGroupTreeVo> children;

	@Override
	public List<MaintainGroupTreeVo> getChildren() {
		if (this.children == null) {
			this.children = new ArrayList<>();
		}
		return this.children;
	}

}
